<template>
	<view>
		<navView navTitle="付款记录" titleColor="#fff" :isBack="true"></navView>
		<view class="container">
			<view class="list-item" v-for="(item, index) in paylist" :key="index">
				<view class="content">
					<text class="label">{{ item.remark }}</text>
					<text class="date">{{ item.payment_date }}</text>
				</view>
				<text class="amount">+{{ item.amount }}</text>
			</view>
			<!-- 如果需要更多列表项，可以循环渲染 -->
		</view>
		<button class="btn">提交</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				paylist:{},
				id: 1, // 合同id
			}
		},
		onLoad(options){
			console.log(options,'option')
			this.id = options.id
			this.getPayList()
		},
		methods: {
			getPayList(){
				// 调用接口获取付款记录
				this.$request('/addons/qingdong/pays/getSelectList', 'GET', {
					contract_id: this.id
				}).then(res => {
					this.paylist = res.data.data
				})
			}
		}
	}
</script>

<style>
	.container {
		padding: 20px;
		background: #fff;
		border-radius: 30rpx;
	}

	.list-item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 10px 0;
		border-bottom: 1px solid #e0e0e0;
	}

	.content {
		display: flex;
		flex-direction: column;
	}

	.label {
		font-size: 16px;
		font-weight: bold;
		color: #333;
		margin-bottom: 5px;
	}

	.date {
		font-size: 14px;
		color: #888;
	}

	.amount {
		font-size: 16px;
		font-weight: bold;
		color: #333;
	}

	.list-item:last-child {
		border-bottom: none;
	}

	.btn {
		position: fixed;
		width: 95%;
		background: #008EFF;
		color: #fff;
		border-radius: 50rpx;
		left: 50%;
		transform: translate(-50%);
		bottom: 50rpx;
	}
</style>